<?php 
if(isset($data->content_id) && !empty($data->content_id))
	$title = Pages::model()->findByPk($data->content_id)->title;
?>
<div class="row" style="overflow: hidden;width: 330px;">
<input style="float: left" type="text" readonly="readonly" disabled="disabled" id="slpage_title" value="<?php if(isset($title)) echo $title;?>" />
<input type="hidden" name="MenuItems[content_id]" id="slpage_id" value="<?php if(isset($data->content_id)) echo $data->content_id;?>" />
<a style="float: left;margin-left: 10px;" id="newDialog" class="button-s" href="#">Chọn page</a>
<div id="dialog-page"></div>
<script type="text/javascript">
    $("#newDialog").click(function ()    {
        $('#dialog-page').html('<iframe frameborder="0" width="800" height="450" src="<?php echo Yii::app()->createUrl('/admin_menus/dataPage/list')?>"></iframe>')
        .dialog({
            modal: true,
            dialogClass: 'dialog-chose',
            buttons: {"Chose":function(){alert('chosed')}},
            height: 550,
            width: 830,
            title: '<?php echo Yii::t('app','Select a page')?>'
        });
    });

    function selectPage(id) {
	$.ajax({
	  url: "<?php echo Yii::app()->createUrl('/admin_menus/dataPage/getPage')?>",
	  data: "id="+id,
	  dataType: 'JSON',
	  success: function(data){
		  $("#slpage_id").attr("value",data.id);
		  $("#slpage_title").attr("value",data.title);
	  }
	});
	$("#dialog-page").dialog("close");
}
</script>
</div>